<template>
    <div class="progress" :style="styles">
        <div class="progress-bar" :style="{width: rate+'%'}"></div>
        <div class="progress-text">{{ textContent }}</div>
        <div class="progress-box-num">
            <div class="progress-box-num-left" >0%</div>
            <div class="progress-box-num-center" :style="{left:rate+'%'}" v-if="rate>0">{{ rate+'%' }}</div>
            <div class="progress-box-num-right">100%</div>
        </div>
    </div>
</template>

<script>
export default {
    name: 'VProgress',
    props: {
        textContent: {
            type: String,
            default: ""
        },
        styles:{
            type: String,
            default:''
        },
        rate:{
            type:String,
            default:'0'
        },
        height:{
            type:Number,
            default(){
                return 0
            }  
        }
    },
    data() {
        return {

        }
    },
    methods: {

    }
}
</script>

<style scoped lang='scss'>
.progress {
    min-height: 20px;
    background-color: #E7EAEC;
    position: relative;
    width:100%;
}

.progress-bar {
    height: 100%;
}

.progress-bar {
    border-radius: 3.2px 0 0 3.2px;
    background: linear-gradient(to right, #61e9e9 0%, #35a4e4 49.78%, #1053d8 100%);

}

.progress-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    color: #09d9ea;
}

.progress-box-num {
    position: relative;
    height: 20px;
    display: flex;
    align-items: center;
    color: #3E525D;
}

.progress-box-num-left {
    position: absolute;
    left: 0;

}

.progress-box-num-center {
    position: absolute;
}

.progress-box-num-right {
    right: 0;
    position: absolute;
}
</style>